package com.icoolkj.ms.common.core.exception;

import com.icoolkj.ms.common.core.enums.ResponseEnum;
import lombok.Data;

/**
 * @author icoolkj
 * @version 1.0
 * @description 业务异常
 * @createDate 2025/02/10 17:38
 */
@Data
public class IcoolkjMSException extends RuntimeException {

    private static final long serialVersionUID = 1L;

    private Object object;

    private ResponseEnum responseEnum;

    public IcoolkjMSException(String msg) {
        super(msg);
    }

    public IcoolkjMSException(String msg, Object object) {
        super(msg);
        this.object = object;
    }

    public IcoolkjMSException(String msg, Throwable cause) {
        super(msg, cause);
    }

    public IcoolkjMSException(ResponseEnum responseEnum) {
        super(responseEnum.getMessage());
        this.responseEnum = responseEnum;
    }

    public IcoolkjMSException(ResponseEnum responseEnum, Object object) {
        super(responseEnum.getMessage());
        this.responseEnum = responseEnum;
        this.object = object;
    }

}
